/**
 * 
 */
package service.exception;

/**
 * @author Lucas
 *
 */
public class CartException extends Exception {
    
    /**
     * 
     */
    private static final long serialVersionUID = -6503459973556298408L;

    public enum CODE{
        INVALIDE_EXIST_ITEM,
        NO_AMOUNT_LEFT,
        ERROR_IN_ADD_CART_ITEM,
        INVALIDE_CART_ITEM,
        CART_AMOUNT_MISMATCH,
        ERROR_IN_REMOVE_ITEM,
        NO_ITEM_ADD,
        AMOUNT_MISMATCH_IN_UPDATECARTITEM,
        ITEM_NOT_IN_CART,
        INVALIDE_BALANCE,
        NOT_ENOUGH_FUNDS,
        ERROR_IN_GET_BALANCE,
        UNKNOWN,
        INVALIDE_REMOVE_AMOUNT
        
    }
    
    private CODE m_code;
    
    public CartException(CODE code){
        super(code.toString());
        m_code = code;
    }
    
    public CartException(CODE code, Throwable e){
        super(code.toString(),e);
        m_code = code;
    }


}
